/**
 *
 */
package com.yangtao.prototype.system.domain;

import com.yangtao.framework.hibernate.BaseEntity;

import javax.persistence.*;

/**
 * 功能权限类， <br>
 * 功能权限和用户角色关联
 *
 * @author 杨涛
 * @version 1.0
 */
@Entity
@Table(name = "sys_data_auth")
public class DataAuthority extends BaseEntity {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 数据权限对应的用户
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	private User user;

	/**
	 * 权限关联的资源类型
	 */
	@Column(length = 2)
	private String resourceType;
	/**
	 * 资源Id
	 */
	@Column(length = 20)
	private String resourceId;

	/**
	 * @return the user
	 */
	public User getUser() {
		return user;
	}

	/**
	 * @param user the user to set
	 */
	public void setUser(User user) {
		this.user = user;
	}

	/**
	 * @return the resourceType
	 */
	public String getResourceType() {
		return resourceType;
	}

	/**
	 * @param resourceType the resourceType to set
	 */
	public void setResourceType(String resourceType) {
		this.resourceType = resourceType;
	}

	/**
	 * @return the resourceId
	 */
	public String getResourceId() {
		return resourceId;
	}

	/**
	 * @param resourceId the resourceId to set
	 */
	public void setResourceId(String resourceId) {
		this.resourceId = resourceId;
	}
}
